package com.qfedu.demo.springboot.nginx;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class MainController {

	private Logger LOG = LoggerFactory.getLogger(MainController.class);
	
	@GetMapping("/")
	String toMain (Map<String, Object>map) {
		map.put("title", "Welcome to nginx...");
		map.put("content", "hello, nginx...");
		// 返回视图名称，thmeleaf默认在/templates目录下找main.html
		return "main";
	}

	@GetMapping("/lb")
	String loadBalance (Map<String, Object>map) {
		map.put("title", "Welcome to nginx...");
		map.put("content", "hello, nginx...");
		LOG.info("loadBalance...");
		// 返回视图名称，thmeleaf默认在/templates目录下找main.html
		return "main";
	}
}
